<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{admin/common/common}">
<head>
    <title>管理员管理</title>
</head>

<body layout:fragment="content">
<form id="myForm" th:action="@{/user/list}" th:method="get">
    <div class="page-container">
        <div class="text-c">
            <input type="text" class="input-text" style="width:150px" placeholder="输入管理员名称" name="realName" th:value="${realName}"/>
            <input type="text" class="input-text" style="width:150px" placeholder="输入登陆账号" name="accountName" th:value="${accountName}"/>
            <input type="text" class="input-text" style="width:200px" placeholder="输入手机号码" name="phone" th:value="${phone}"/>
            <span class="select-box inline">
				<select name="status" class="select">
					<option value="">全部状态</option>
					<option value="1" th:selected="${status} eq 1">启用</option>
					<option value="0" th:selected="${status} eq 0">停用</option>
				</select>
			</span>
            <button type="submit" class="btn btn-success">
                <i class="Hui-iconfont">&#xe665;</i>
                搜用户
            </button>
        </div>
        <div class="cl pd-5 bg-1 bk-gray mt-20">
            <span class="l">
                <a sa:hasPermission="user:add" href="javascript:;" th:onclick="'javascript:admin_add(\'添加管理员\',\'/user/add\',\'800\',\'500\');'" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加管理员</a>
            </span>
        </div>
        <table class="table table-border table-bordered table-bg table-hover">
            <thead>
            <tr>
                <th scope="col" colspan="7">管理员列表</th>
            </tr>
            <tr class="text-c">
                <!--<th width="25"><input type="checkbox" name="" value=""/></th>-->
                <th>姓名</th>
                <th>账号</th>
                <th>性别</th>
                <th>手机号码</th>
                <th>更新时间</th>
                <th>状态</th>
                <th width="100">操作</th>
            </tr>
            </thead>
            <tbody>
            <tr class="text-c" th:each="model:${pageInfo?.result}" th:object="${model}">
                <td th:text="*{realName}">d</td>
                <td th:text="*{accountName}">d</td>
                <td>
                  <span th:if="*{sex} eq 1">男</span>
                  <span th:if="*{sex} eq 0">女</span>
                </td>
                <td th:text="*{phone}">d</td>
                <td th:text="*{#dates.format(updateTime, 'yyyy-MM-dd HH:mm')}">2014-6-11 11:11:42</td>
                <td class="td-status">
                  <span th:if="*{status} eq 1" class="label label-success radius">已启用</span>
                  <span th:if="*{status} eq 0" class="label radius">已停用</span>
                </td>
                <td class="td-manage">
                    <a style="text-decoration:none" th:if="*{status} eq 1" sa:hasPermission="user:status" th:onclick="'javascript:admin_status( \'/user/updateStatus?userId='+*{id}+'\');'" href="javascript:;" title="停用"><i class="Hui-iconfont">&#xe631;</i></a>
                    <a style="text-decoration:none" th:if="*{status} eq 0" sa:hasPermission="user:status" th:onclick="'javascript:admin_status( \'/user/updateStatus?userId='+*{id}+'\');'" href="javascript:;" title="停用"><i class="Hui-iconfont">&#xe615;</i></a>
                    <a title="编辑" sa:hasPermission="user:edit" href="javascript:;" onclick="admin_edit('管理员编辑','admin-add.html','2','800','500')" th:onclick="'javascript:admin_edit(\'管理员编辑\',\'/user/edit?id='+*{id}+'\',\'800\',\'500\');'" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>
                    <a title="删除"  sa:hasPermission="user:delete" href="javascript:;" onclick="admin_del(this,'1')" th:onclick="'javascript:admin_del(this, \'/user/delete?id='+*{id}+'\');'" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a>
                </td>
            </tr>
            </tbody>
        </table>
        <div th:replace="admin/common/page :: page"></div>
    </div>
</form>

<script type="text/javascript" th:src="@{/js/common/page.js}"></script>
<script type="text/javascript" th:src="@{/js/admin/manager/admin-list.js}"></script>
<script th:inline="javascript">

</script>
</body>
</html>